package com.sunyard.myEnum;

import com.sunyard.constant.manage.ManageConstant;

/**
 * @ClassName: UrlEnum
 * @PackageName: com.sunyard.constant
 * @Deescription: url枚举类
 * @Author: jiaf.lv
 * @Version: V1.0
 **/
public enum UrlEnum {
    /**
     * uat
     */
    AMAZON_URL(ManageConstant.UAT_AMAZON, ManageConstant.UAT_URL),
    AMAZON_URL_1(ManageConstant.UAT_AMAZON_LW, ManageConstant.UAT_URL_1),

    /**
     * prod
     */
    UAT_URL(ManageConstant.PROD_AMAZON, ManageConstant.PROD_URL);

    private final String type;

    private final String desc;

    UrlEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getValue(String type) {
        UrlEnum[] tellerEnums = values();
        for (UrlEnum tellerEnum : tellerEnums) {
            if (tellerEnum.type().equals(type)) {
                return tellerEnum.desc();
            }
        }
        return "";
    }

    public static String getType(String desc) {
        UrlEnum[] tellerEnums = values();
        for (UrlEnum tellerEnum : tellerEnums) {
            if (tellerEnum.desc().equals(desc)) {
                return tellerEnum.type();
            }
        }
        return "";
    }

    private String type() {
        return this.type;
    }

    private String desc() {
        return this.desc;
    }
}
